package petshop.agronunes.entidade;

import java.io.Serializable;
import java.math.BigDecimal;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity
@Table(name = "funcionario")
public class Funcionario implements Serializable {
	private static final long serialVersionUID = 1L;

	private Integer pkCodigo;
	private String dsNome;
	private String dsEndereco;
	private String dsTelefone;
	private String dsCargo;
	private String dsCRMV;
	private BigDecimal vlSalario;
	
	public Funcionario() {
		super();
	}	
	
	public Funcionario(Integer pkCodigo, String dsNome, String dsEndereco,
			String dsTelefone, String dsCargo, String dsCRMV, BigDecimal vlSalario) {
		super();
		this.pkCodigo = pkCodigo;
		this.dsNome = dsNome;
		this.dsEndereco = dsEndereco;
		this.dsTelefone = dsTelefone;
		this.dsCargo = dsCargo;
		this.dsCRMV = dsCRMV;
		this.vlSalario = vlSalario;
	}

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	public Integer getPkCodigo() {
		return this.pkCodigo;
	}

	public void setPkCodigo(Integer pkCodigo) {
		this.pkCodigo = pkCodigo;
	}

	@Column(name = "ds_Nome", nullable = false, length = 30)
	public String getDsNome() {
		return this.dsNome;
	}

	public void setDsNome(String dsNome) {
		this.dsNome = dsNome;
	}
	
	@Column(name = "ds_Endereco", length = 50)
	public String getDsEndereco() {
		return this.dsEndereco;
	}

	public void setDsEndereco(String dsEndereco) {
		this.dsEndereco = dsEndereco;
	}
	
	@Column(name = "ds_Telefone", length = 20)
	public String getDsTelefone() {
		return this.dsTelefone;
	}

	public void setDsTelefone(String dsTelefone) {
		this.dsTelefone = dsTelefone;
	}
	
	@Column(name = "ds_Cargo", length= 50)
	public String getDsCargo(){
		return this.dsCargo;
	}
	
	public void setDsCargo(String dsCargo){
		this.dsCargo = dsCargo;
	}
	
	@Column(name = "ds_CRMV", length = 60)
	public String getDsCRMV(){
		return this.dsCRMV;
	}	
			
	public void setDsCRMV(String dsCRMV){
		this.dsCRMV = dsCRMV;
	}
	
	@Column(name = "vl_Salario", precision = 9, scale = 2)
	public BigDecimal getVlSalario() {
		return vlSalario;
	}
	public void setVlSalario(BigDecimal vlSalario) {
		this.vlSalario = vlSalario;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((pkCodigo == null) ? 0 : pkCodigo.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Funcionario other = (Funcionario) obj;
		if (pkCodigo == null) {
			if (other.pkCodigo != null)
				return false;
		} else if (!pkCodigo.equals(other.pkCodigo))
			return false;
		return true;
	}
}